In current business scenarios, rapid market changes can lead to constant variations in customer requirements. Commercial establishments must respond by altering their business models and applications in order to implement changes in their businesses. The flexibility and rapid adaptability in keeping pace with changing requirements play a key role in the success or failure of the business.
The majority of prior art applications embed or hard-code the business logic in a code, thereby rendering it difficult to change the application quickly to adapt to changing market needs. Similarly, altering the application calls for the developers to modify the logic, which most often amounts to reworking the code, which is a time consuming and expensive proposition.
As businesses strive to become more agile and competitive, they need to increase productivity, lower development costs, support customization and maintenance, and reduce time-to-market. Each application possesses its own set of business logic, which may not be shared across applications. Such business logic should comply with the business requirements of a company. A change in business policy, for example, calls for some changes in every application containing such business logic.
A rule-based system can be a promising approach for use in addressing the aforementioned problems. The business logic is separated from the rest of the application code, and hence unforeseen changes can be easily handled. In this manner, the application can become more nimble and competitive, and the domain experts can make changes to the business logic, with perhaps little or no assistance from the developers. This approach therefore allows users to create, modify or remove business rules to reflect the dynamic changes in the business logic.
In a rule-based expert system, a knowledge base typically incorporates definitions of facts and rules along with control information. An inference engine, which is sometimes referred to as a “rule interpreter” or a “rule engine” provides a reasoning mechanism in the expert system. The inference engine typically implements forward chaining and backward chaining strategies. Forward chaining is a process of applying a set of previously determined rules to the facts in a knowledge base to determine if any of them are active and thereby generate new facts. In essence, all derivable knowledge can be derived in forward chaining. Backward chaining is goal-driven and utilized to process some queries against the knowledge base. A query can be considered as a goal and the knowledge base can be searched for facts supporting that goal. Antecedents of such rules are made sub goals for further search, if necessary. Inference engines designed for expert systems are increasingly utilized in business automation.
The RETE match algorithm is widely accepted as one of the best solutions for many pattern or object pattern-matching problems. RETE generally refers to a Latin word ‘rete’ that means net or network which provides the basis for a more efficient implementation of the rule-based expert system. The majority of current rule-based systems utilize the RETE match algorithm to optimize their performance and are mainly applied in production systems for the support of forward chaining inference. One of the main advantages of the RETE match algorithm is that it saves state information between the forward cycles. In every cycle only the working memory changes are processed. Moreover, this algorithm exploits the structural redundancy of the rules.
The RETE algorithm improves the speed of forward-chained rule systems by limiting the effort required to recompute the conflict set after a rule is fired. Other advantages of the RETE algorithm include “temporal redundancy” and “structural similarity”. Temporal redundancy occurs because firing of the rule usually changes only a few facts, and only a few rules are affected by each of those changes. Structural similarities exist because the same pattern often appears in the left-hand side of more than one rule. Facts are variable-free tuples, patterns are tuples with some variables, and rules possess left-hand side lists of patterns.
The RETE algorithm utilizes a rooted acyclic directed graph, referred to as the RETE or RETE network, where nodes, with the exception of the root, represent patterns; and paths from the root to the leaves represent the left-hand side of rules. At each node is stored information about the facts satisfied by the patterns of the nodes in the paths from the root up to and including this node. This information constitutes a relation representing the possible values of the variables occurring in the patterns in the path.
The RETE methodology provides for keeping the information associated with the nodes in the graph up to date. A working memory element (WME) is an input data structure. When a fact is added or removed from a working memory, a token representing that fact and operation is entered at the root of the graph and propagated to its leaves modifying, as appropriate, the information associated with the nodes. Each time a token is pushed or processed through the RETE and is matched with patterns in a RETE, a pattern match operation results. Some prior art systems utilize RETE algorithms in object-oriented or object-based environments, which constitutes the mainstream of current software development, such as “Jess”. Jess is a rule engine and scripting environment written entirely in Sun's Java™ language by Ernest Friedman-Hill of Sandia National Laboratories in Livermore, Calif. Using Jess, developers can construct Java software with the capacity to “reason” using knowledge supplied in the form of declarative rules. Another java-based RETE implementation is the “drools” approach.
Object oriented (OO) techniques have been widely utilized to produce software systems that fulfill business requirements. Objects are autonomous entities with an optional state and which respond to requests. An object functions as an entity that encapsulates some private state information or data, a set of associated operations or procedures that manipulate the data; or a possible thread of control so that collectively such a formation can be treated as a single unit. Object-oriented systems include two important features in addition to encapsulation. “Inheritance” is a mechanism that permits objects to be developed from existing objects simply by specifying how the new objects differ from the original. This means that an object may inherit the behavior and operations of a super object. All objects can communicate using the mechanism of message passing, and the processing activity takes place within objects. Inheritance allows classification, sub-classification and super-classification of objects, which permits their properties to be shared. “Polymorphism” is the ability of the entity for e.g., a variable, to refer to instances of different classes at run-time. Practically, this means that a single message to an object can be processed in different ways depending on the object itself.
The majority of prior art RETE object-oriented rule engines possess unnatural expressions of business rules with regards to business objects. Another limitation of these rule engines is that they are typically based on a dynamic language, script environment and reflection features. Hence, such engines cannot be utilized in static object-oriented language such as C++, with full compilation of rule-base approaches.
Based on the foregoing it is believed that a need exists for an improved system and method that integrates both object-oriented technology and rule-based reasoning approaches. Additionally, a need exists for providing a methodology to add decision-making and inferencing capabilities to business applications.